package com.cc.visitor.enums;

/**
 * @author chanchaw
 * @create 2024-10-07 15:32
 */
public enum UserType {
    VISITOR(0,"来访者","来访者"),INTERVIEWEE(1,"被访者","被访者"),
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    UserType(int id,String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static UserType ofid(int id){
        for(UserType item:UserType.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static UserType ofsid(String sid){
        for(UserType item:UserType.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
